RiverSync
SPEC-DDD-AUD · v0.2
28 June 2026
Owner: Platform team

Audit — the attribution-trail bounded context

The platform's memory: a per-tenant log with polymorphic attribution — partner actions carry the attributed org, RiverSync view-as actions carry the session and land in both the customer's log and the RiverSync trail. It writes nothing of its own; it remembers everything everyone else does. A generic subdomain, integrated as a pure conformist to the published event language.

DraftGeneric subdomainAppend-only trail
Drill-down of the master domain architecture. Requirements: SPEC-PRD (PRT-4) + SPEC-APP-ADM (ADM-5). Boundaries, routes and events render from domain/domain-catalog.js — definitions are never copied per document.

1Ownership & boundaries

Audit is a pure consumer with a read API. There is no public write endpoint: facts arrive on the backbone (SVC-8), already carrying actor, attributed org and view-as session in the envelope. ViewAsSession itself belongs to Identity — Audit only references it for the dual-trail pairing.

Reads from: the whole event backbone (wildcard subscription) · Identity (ViewAsSession attribution). Account reads the customer log; Admin reads the cross-tenant trail.

2Ubiquitous language

The words this context uses — the same in code, conversation and spec.

3Aggregates & invariants

One append-only aggregate — the root guards immutability and the polymorphic attribution; facts arrive only on the backbone.

4Context relationships

How this context meets its neighbours — a conformist downstream of every context, consuming the published event language.

5Physical view — the service API

The deployment mapping: this context becomes the Audit service — a read API only; the write side is the backbone. Paths relative to api.riversync.com/v1; access notation per the master.

RiverSync Co., Ltd. · BangkokSPEC-DDD-AUD · 1 of 2

6Domain events

Audit publishes nothing and consumes everything — the full backbone catalog below is its input contract.

7Invariants in play

The modeling rules that bind this context — the master holds the full set; data integrity stays with the ERD drill-downs.

8Revision history

VersionDateChanges
0.112 Jun 2026First draft — split proposed with SPEC-DDD v0.1
0.228 Jun 2026Reframed as a Domain-Driven Design context (with the set, SPEC-DDD v0.14) — leads with ubiquitous language & the single AuditEvent aggregate and the context relationships (conformist to the published event language of every context). Classified a generic subdomain; the API is demoted to the physical view. No ownership change.
RiverSync Co., Ltd. · BangkokSPEC-DDD-AUD · 2 of 2